package com.ruoyi.quality.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quality.mapper.QualitySaleMapper;
import com.ruoyi.quality.domain.QualitySale;
import com.ruoyi.quality.service.IQualitySaleService;

/**
 * 销售Service业务层处理
 * 
 * @author wky
 * @date 2024-06-15
 */
@Service
public class QualitySaleServiceImpl implements IQualitySaleService 
{
    @Autowired
    private QualitySaleMapper qualitySaleMapper;

    /**
     * 查询销售
     * 
     * @param saleId 销售主键
     * @return 销售
     */
    @Override
    public QualitySale selectQualitySaleBySaleId(Long saleId)
    {
        return qualitySaleMapper.selectQualitySaleBySaleId(saleId);
    }

    /**
     * 查询销售列表
     * 
     * @param qualitySale 销售
     * @return 销售
     */
    @Override
    public List<QualitySale> selectQualitySaleList(QualitySale qualitySale)
    {
        return qualitySaleMapper.selectQualitySaleList(qualitySale);
    }

    /**
     * 新增销售
     * 
     * @param qualitySale 销售
     * @return 结果
     */
    @Override
    public int insertQualitySale(QualitySale qualitySale)
    {
        qualitySale.setCreateTime(DateUtils.getNowDate());
        return qualitySaleMapper.insertQualitySale(qualitySale);
    }

    /**
     * 修改销售
     * 
     * @param qualitySale 销售
     * @return 结果
     */
    @Override
    public int updateQualitySale(QualitySale qualitySale)
    {
        return qualitySaleMapper.updateQualitySale(qualitySale);
    }

    /**
     * 批量删除销售
     * 
     * @param saleIds 需要删除的销售主键
     * @return 结果
     */
    @Override
    public int deleteQualitySaleBySaleIds(Long[] saleIds)
    {
        return qualitySaleMapper.deleteQualitySaleBySaleIds(saleIds);
    }

    /**
     * 删除销售信息
     * 
     * @param saleId 销售主键
     * @return 结果
     */
    @Override
    public int deleteQualitySaleBySaleId(Long saleId)
    {
        return qualitySaleMapper.deleteQualitySaleBySaleId(saleId);
    }
}
